package Day14;

import java.util.*;
// 1:无需package
// 2: 类名必须Main, 不可修改
/**
 * 2021Java真题:最少刷题数
 * https://www.lanqiao.cn/problems/2143/learning/
 */
public class Main3 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int n = scan.nextInt();
        int[] arr1 = new int[n];
        int[] arr2 = new int[n];
        for(int i = 0; i < n; i++){
            arr1[i] = arr2[i] = scan.nextInt();
        }

        Arrays.sort(arr1);
        int mid = n / 2;
        int x = arr1[mid];

        int min = 0 , max = 0;
        for(int i = 0; i < n; i++){
            if(arr1[i] < x){
                min++;
            }else if(arr1[i] > x){
                max++;
            }else{
                continue;
            }
        }


        int[] arr3 = new int[n];
        for(int i = 0; i < n; i++){
            if (arr2[i] < x && min > max){
                arr3[i] = x - arr2[i];
            }else if (arr2[i] < x && min <= max){
                arr3[i] = x - arr2[i] + 1;
            }else if (arr2[i] == x && min < max){
                arr3[i] = 1;
            }else {
                arr3[i] = 0;
            }
            System.out.print(arr3[i]+ " ");
        }
        scan.close();
    }
}